package com.example.core.libs;

import com.example.core.libs.JSONResult;
import lombok.Data;

@Data
public class AppException extends RuntimeException {
    private int code = 500;

    public AppException(int code) {
        this(code, "");
    }

    public AppException(String msg) {
        super(msg);
    }

    public AppException(int code, String msg) {
        super(msg);
        this.code = code;
    }


    public AppException(JSONResult result) {
        this(result.getCode(), result.getMessage());
    }
}
